package com.eam.source;

import org.openbravo.client.kernel.BaseComponentProvider;
import org.openbravo.client.kernel.Component;
import org.openbravo.client.kernel.ComponentProvider;
import javax.enterprise.context.ApplicationScoped;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

@ApplicationScoped
@ComponentProvider.Qualifier(ImportEamJsComponentProvider.BASE_JS_IMPORT)
public class ImportEamJsComponentProvider extends BaseComponentProvider {
	public static final String BASE_JS_IMPORT = "BASE_JS_IMPORT";

	@Override
	public Component getComponent(String componentId, Map<String, Object> parameters) {
		throw new IllegalArgumentException("Component id " + componentId + " not supported.");
	}

	@Override
	public List<ComponentResource> getGlobalComponentResources() {
	    final List<ComponentResource> globalResources = new ArrayList<ComponentResource>();

		globalResources.add(createStaticResource("web/com.eam/js/Checkbutton.js", false));
		globalResources.add(createStaticResource("web/com.eam/js/eam-facilities-manager.js", false));
		globalResources.add(createStaticResource("web/com.eam/js/eam_checkplan_button.js", false));
		globalResources.add(createStaticResource("web/com.eam/js/eam_facilities_print.js", false));
		globalResources.add(createStaticResource("web/com.eam/js/SparepartAddsbutton.js", false));
		globalResources.add(createStaticResource("web/com.eam/js/SparepartInventorybutton.js", false));
		return globalResources;
	}

	public List<String> getTestResources() {
		return Collections.emptyList();
	}
}
